<?php

/**
 * This is the model class for table "dokterparamedisdukun".
 *
 * The followings are the available columns in table 'dokterparamedisdukun':
 * @property integer $dpd_id
 * @property integer $dpd_kec
 * @property integer $dpd_dokt_umum
 * @property integer $dpd_dokt_spesialis
 * @property integer $dpd_dokt_gigi
 * @property integer $dpd_parmed_prwtn
 * @property integer $dpd_parmed_bidan
 * @property integer $dpd_tu
 * @property integer $dpd_dukunberanak
 * @property integer $dpd_kunjungan
 * @property integer $dpd_tahun
 *
 * The followings are the available model relations:
 * @property Kecamatan $dpdKec
 */
class Dokterparamedisdukun extends CActiveRecord
{
	/**
	 * Returns the static model of the specified AR class.
	 * @return Dokterparamedisdukun the static model class
	 */
	public static function model($className=__CLASS__)
	{
		return parent::model($className);
	}

	/**
	 * @return string the associated database table name
	 */
	public function tableName()
	{
		return 'dokterparamedisdukun';
	}

	/**
	 * @return array validation rules for model attributes.
	 */
	public function rules()
	{
		// NOTE: you should only define rules for those attributes that
		// will receive user inputs.
		return array(
			array('dpd_kec, dpd_dokt_umum, dpd_dokt_spesialis, dpd_dokt_gigi, dpd_parmed_prwtn, dpd_parmed_bidan, dpd_tu, dpd_dukunberanak, dpd_kunjungan, dpd_tahun', 'numerical', 'integerOnly'=>true),
			// The following rule is used by search().
			// Please remove those attributes that should not be searched.
			array('dpd_id, dpd_kec, dpd_dokt_umum, dpd_dokt_spesialis, dpd_dokt_gigi, dpd_parmed_prwtn, dpd_parmed_bidan, dpd_tu, dpd_dukunberanak, dpd_kunjungan, dpd_tahun', 'safe', 'on'=>'search'),
		);
	}

	/**
	 * @return array relational rules.
	 */
	public function relations()
	{
		// NOTE: you may need to adjust the relation name and the related
		// class name for the relations automatically generated below.
		return array(
			'dpdKec' => array(self::BELONGS_TO, 'Kecamatan', 'dpd_kec'),
		);
	}

	/**
	 * @return array customized attribute labels (name=>label)
	 */
	public function attributeLabels()
	{
		return array(
			'dpd_id' => 'Dpd',
			'dpd_kec' => 'Dpd Kec',
			'dpd_dokt_umum' => 'Dpd Dokt Umum',
			'dpd_dokt_spesialis' => 'Dpd Dokt Spesialis',
			'dpd_dokt_gigi' => 'Dpd Dokt Gigi',
			'dpd_parmed_prwtn' => 'Dpd Parmed Prwtn',
			'dpd_parmed_bidan' => 'Dpd Parmed Bidan',
			'dpd_tu' => 'Dpd Tu',
			'dpd_dukunberanak' => 'Dpd Dukunberanak',
			'dpd_kunjungan' => 'Dpd Kunjungan',
			'dpd_tahun' => 'Dpd Tahun',
		);
	}

	/**
	 * Retrieves a list of models based on the current search/filter conditions.
	 * @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions.
	 */
	public function search()
	{
		// Warning: Please modify the following code to remove attributes that
		// should not be searched.

		$criteria=new CDbCriteria;

		$criteria->compare('dpd_id',$this->dpd_id);
		$criteria->compare('dpd_kec',$this->dpd_kec);
		$criteria->compare('dpd_dokt_umum',$this->dpd_dokt_umum);
		$criteria->compare('dpd_dokt_spesialis',$this->dpd_dokt_spesialis);
		$criteria->compare('dpd_dokt_gigi',$this->dpd_dokt_gigi);
		$criteria->compare('dpd_parmed_prwtn',$this->dpd_parmed_prwtn);
		$criteria->compare('dpd_parmed_bidan',$this->dpd_parmed_bidan);
		$criteria->compare('dpd_tu',$this->dpd_tu);
		$criteria->compare('dpd_dukunberanak',$this->dpd_dukunberanak);
		$criteria->compare('dpd_kunjungan',$this->dpd_kunjungan);
		$criteria->compare('dpd_tahun',$this->dpd_tahun);

		return new CActiveDataProvider($this, array(
			'criteria'=>$criteria,
		));
	}
}